<?php

/**
 * Guildhistory filter form base class.
 *
 * @package    raidpoints
 * @subpackage filter
 * @author     David Driscoll
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 24171 2009-11-19 16:37:50Z Kris.Wallsmith $
 */
abstract class BaseGuildhistoryFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'aaction'        => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'savedate'       => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
      'actiondate'     => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
      'dt'             => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
      'scheduled_date' => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'playerid'       => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'raidid'         => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'value'          => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'ttype'          => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'waitlistflag'   => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'itemid'         => new sfWidgetFormFilterInput(),
      'zoneid'         => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'reasonid'       => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'comment'        => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'created_by'     => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'updated_by'     => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'created_at'     => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
      'updated_at'     => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
    ));

    $this->setValidators(array(
      'aaction'        => new sfValidatorPass(array('required' => false)),
      'savedate'       => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
      'actiondate'     => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
      'dt'             => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
      'scheduled_date' => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDateTime(array('required' => false)))),
      'playerid'       => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'raidid'         => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'value'          => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'ttype'          => new sfValidatorPass(array('required' => false)),
      'waitlistflag'   => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'itemid'         => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'zoneid'         => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'reasonid'       => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'comment'        => new sfValidatorPass(array('required' => false)),
      'created_by'     => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'updated_by'     => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'created_at'     => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
      'updated_at'     => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
    ));

    $this->widgetSchema->setNameFormat('guildhistory_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Guildhistory';
  }

  public function getFields()
  {
    return array(
      'id'             => 'Number',
      'aaction'        => 'Text',
      'savedate'       => 'Date',
      'actiondate'     => 'Date',
      'dt'             => 'Date',
      'scheduled_date' => 'Date',
      'playerid'       => 'Number',
      'raidid'         => 'Number',
      'value'          => 'Number',
      'ttype'          => 'Text',
      'waitlistflag'   => 'Boolean',
      'itemid'         => 'Number',
      'zoneid'         => 'Number',
      'reasonid'       => 'Number',
      'comment'        => 'Text',
      'created_by'     => 'Number',
      'updated_by'     => 'Number',
      'created_at'     => 'Date',
      'updated_at'     => 'Date',
    );
  }
}
